package com.example.zuoye;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
    private EditText tv_name;
    private EditText tv_password;
    private Button btn_register;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tv_name = (EditText) findViewById(R.id.tv_name);
        tv_password = (EditText) findViewById(R.id.tv_password);
        btn_register = (Button) findViewById(R.id.btn_register);
        btn_register.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                passDate();
            }
        });
    }
    public void passDate(){
        Intent intent = new Intent(this, ShowActivity.class);
        intent.putExtra("name", tv_name.getText().toString().trim());
        intent.putExtra("password", tv_password.getText().toString().trim());
        startActivity(intent);
    }
}
